package cn.exrick.xboot.base.entity

import cn.exrick.xboot.core.base.XbootBaseEntityKt
import cn.exrick.xboot.core.common.utils.SnowFlakeUtil
import com.baomidou.mybatisplus.annotation.TableField
import com.baomidou.mybatisplus.annotation.TableId
import com.baomidou.mybatisplus.annotation.TableName
import com.fasterxml.jackson.annotation.JsonFormat
import io.swagger.annotations.ApiModel
import io.swagger.annotations.ApiModelProperty
import org.hibernate.annotations.DynamicInsert
import org.hibernate.annotations.DynamicUpdate
import org.springframework.format.annotation.DateTimeFormat
import java.util.*
import javax.persistence.*

/**
 * @author Fei
 */
@Entity
@DynamicInsert
@DynamicUpdate
@Table(name = "en_enterprise_common_param")
@TableName("en_enterprise_common_param")
@ApiModel(value = "企业通用参数")
data class EnterpriseCommonParam(

        @ApiModelProperty("企业id")
        var enterpriseUserId: String? = null,

        @ApiModelProperty("开始考试时间")
        @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
        @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
        var examStartTime: Date? = null,

        @ApiModelProperty("入参")
        @Transient
        @TableField(exist = false)
        var examStartTimeStr: String? = null,

        @ApiModelProperty("考试可以延长的时间")
        var examCanExtentTime: Int? = 0,

        @ApiModelProperty("培训合格奖励金额")
        var trainingPassMoney: Double? = 0.0,

        @ApiModelProperty("培训不合格扣发金额")
        var trainingNotPassMoney: Double? = 0.0,

        @ApiModelProperty("安全风险得分金额")
        var safeScoreMoney: Double? = 0.0,

        @ApiModelProperty("员工安全承诺")
        @Column(length = 1000)
        var employeeSafePromise: String? = null,

        @ApiModelProperty("企业安全承诺")
        @Column(length = 1000)
        var enterpriseSafePromise: String? = null,

        @ApiModelProperty("公司概况")
        @Column(length = 1000)
        var overview: String? = ""

) : XbootBaseEntityKt() {

    @Id
    @TableId
    override var id: String = SnowFlakeUtil.nextId().toString()

    companion object{
        private const val serialVersionUID = 1L
    }
}